<?php
declare (strict_types=1);
/**
 * @Description:
 * @Author: Chern
 * @Date: 2023/7/10
 * @Time: 17:40
 */

namespace app\validate;

use think\Validate;

class Organization extends Validate
{
    protected $rule = [
        'title'=>['require'],
        'type'=>['require'],
        'parent_id' =>['require'],
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'title.require'=>'组织名称为空',
        'parent_id.require' => '上级组织为空',
    ];

    /**
     * 新增数据控制验证字段
     */
    protected $scene = [
        'del'=>['id'],
    ];

}